{% import "_includes/forms" as forms %}

{% if not craft.app.config.general.useEmailAsUsername %}
    {{ forms.textField({
        first: true,
        label: "Username"|t('app'),
        id: 'username',
        name: 'username',
        value: (user is defined ? user.username : null),
        autofocus: true,
        autocomplete: false,
        required: (isNewUser or (currentUser.admin or user.getIsCurrent()) ? true : false),
        disabled: (isNewUser or (currentUser.admin or user.getIsCurrent()) ? false : true),
        errors: (user is defined ? user.getErrors('username') : null),
        inputAttributes: {
            data: {lpignore: 'true'},
        },
    }) }}
{% endif %}

{{ forms.textField({
    fieldClass: 'width-50',
    label: "First Name"|t('app'),
    id: 'firstName',
    name: 'firstName',
    value: user.firstName,
    autocomplete: false,
    errors: user.getErrors('firstName'),
    autofocus: craft.app.config.general.useEmailAsUsername,
    inputAttributes: {
        data: {lpignore: 'true'},
    },
}) }}

{{ forms.textField({
    fieldClass: 'width-50',
    label: "Last Name"|t('app'),
    id: 'lastName',
    name: 'lastName',
    value: user.lastName,
    autocomplete: false,
    errors: user.getErrors('lastName'),
    inputAttributes: {
        data: {lpignore: 'true'},
    },
}) }}
